package com.net.xpay.common.manager.impl.notify;

import com.net.common.dao.BasicMapper;
import com.net.xpay.common.dao.notify.FlexibleStaffCardNotifyRecordMapper;
import com.net.xpay.common.domain.notify.FlexibleStaffCardNotifyRecord;
import com.net.xpay.common.manager.notify.FlexibleStaffCardNotifyRecordManager;
import com.net.common.manager.AbstractManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;


@Component
public class FlexibleStaffCardNotifyRecordManagerImpl extends AbstractManager<FlexibleStaffCardNotifyRecord> implements FlexibleStaffCardNotifyRecordManager{

    @Autowired
    private FlexibleStaffCardNotifyRecordMapper mapper;


    @Override
    protected BasicMapper<Long, FlexibleStaffCardNotifyRecord> getMapper() {
        return mapper;
    }

    @Override
    public int deleteFinishedRecord(LocalDateTime deadline) {
        return mapper.deleteFinishedRecord(deadline);
    }

    @Override
    public List<Long> listWaitNotifyRecordIds(int limitCount) {
        List<Long> ids = mapper.listWaitNotifyRecordIds(limitCount);
        return ids == null ? new ArrayList<>() : ids;
    }
}
